function ccR_Warlock_3()
	if ccrPlayerLevel() >= 10 and ccrPlayerLevel() <= 90 then ccR_Warlock_Destruction_10_90() end
end

function ccR_Warlock_Destruction_10_90()

	--if ccrSpellIsReady("Demonic Siphon") 	then ccrCast("Demonic Siphon") end
	--if ccrSpellIsReady("Fel Flame Breath") 	then ccrCast("Fel Flame Breath") end
	--if ccrSpellIsReady(132411) 				then ccrCast(132411) end

	-- Before Aftermath, Ensure we dont keep cutting off Rain of Fire
	if ccrPlayerIsChannelingSpell(RAIN_OF_FIRE) then return end

	if ccrPlayerHasSpell(RAIN_OF_FIRE)
	and ccrPlayerHasSpell(AFTERMATH)
	then

		local vCount = ccrTargetCount(12)
		-- Remove buff if we dont have any embers to use it
		-- or we only have 1 target
		if ccrPlayerHasBuff(FIRE_AND_BRIMSTONE)
		and (ccrEmbers() <= 9 or (vCount > 0 and vCount < ccRS.Warlock_3_AoECount))
		then
			for x = 0, 40 do
				local vBuff = UnitBuff("Player", x)
				if vBuff ~= nil
				and vBuff == GetSpellInfo(FIRE_AND_BRIMSTONE)
				then
					CancelUnitBuff("Player", x)
					return
				end
			end
			return
		end

		if ccrPlayerIsInCombat() then
			ccR_Warlock_Imp_Flee()
			ccR_Warlock_Cauterize_Master()
			-- Talents
				-- 15
				ccR_Warlock_Dark_Regeneration()
				-- 30
				ccR_Warlock_Demonic_Breath()
				ccR_Warlock_Mortal_Coil()
				ccR_Warlock_Shadowfury()
			-- Abilities
			ccR_Warlock_Ember_Tap()
			ccR_Warlock_Unending_Resolve()
			ccR_Warlock_Twilight_Ward()
			ccR_Warlock_Backlash()
			ccR_Warlock_Shadowburn()
			ccR_Warlock_Dark_Soul_Instability()
		end

		-- Single Target Rotation
		if (ccRS.Auto_AoE and (vCount >= 1 and vCount <= ccRS.Warlock_3_SingleTargetCount))
		or (ccrTargetIsBoss() and ccRS.Auto_AoE_Ignore_On_Boss)
		or (not ccRS.Auto_AoE and not ccRS.Manual_AoE)
		then

			ccR_Warlock_Havoc()
			ccR_Warlock_Switch_Away_From_Havoc()

			ccR_Warlock_Curse_of_Enfeeblement()
			ccR_Warlock_Curse_of_the_Elements()

			ccR_Warlock_Immolate()
			ccR_Warlock_Conflagrate()
			if ccrPlayerHasBuff(BACKDRAFT)
			and (not ccrTargetIsBoss() or ccrTargetIsRare())
			then
				ccR_Warlock_Incinerate()
				ccR_Warlock_Chaos_Bolt()
			else
				ccR_Warlock_Chaos_Bolt()
				ccR_Warlock_Incinerate()
			end	
		return
		end
		-- AoE Rotation
		if (ccRS.Auto_AoE and vCount >= ccRS.Warlock_3_AoECount)
		or (not ccRS.Auto_AoE and ccRS.Manual_AoE)
		then

			ccR_Warlock_Rain_of_Fire()
			ccR_Warlock_Fire_And_Brimstone()
			ccR_Warlock_Conflagrate()
			ccR_Warlock_Immolate_Single_Target()
			ccR_Warlock_Incinerate()				

		return
		end
	else
		-- No Aftermath so < lvl54
		if ccrPlayerIsInCombat() then
			-- Talents
				-- 15
				ccR_Warlock_Dark_Regeneration()
				-- 30
				ccR_Warlock_Demonic_Breath()
				ccR_Warlock_Mortal_Coil()
				ccR_Warlock_Shadowfury()
			-- Abilities
			ccR_Warlock_Ember_Tap()
		end

		ccR_Warlock_Shadowburn()

		ccR_Warlock_Rain_of_Fire()
		ccR_Warlock_Curse_of_Enfeeblement()
		ccR_Warlock_Havoc()
		ccR_Warlock_Switch_Away_From_Havoc()
		ccR_Warlock_Backlash()

		ccR_Warlock_Corruption()		
		ccR_Warlock_Immolate()
		ccR_Warlock_Chaos_Bolt()
		ccR_Warlock_Conflagrate()
		ccR_Warlock_Incinerate()
	end
end